package org.zjx.task;


import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public abstract class RetryTask extends AbstractTask {
    private int retryCount = 0;
    private int maxRetries = 0;

    public RetryTask(String taskId) {
        super(taskId);
    }

    /**
     * 重置任务状态以便重试
     */
    public void resetForRetry() {
        retryCount++;
        status = TaskStatus.PENDING;
    }

    @Override
    public void initialize(){
        super.initialize();
        retryCount = 0;
    }
}
